package com.woniuxy;

import io.jsonwebtoken.JwtBuilder;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;

import java.util.Date;

/**
 * @Author 罗蔚
 * @Date 2022/4/13 14:28
 * @Description TODO
 */
public class Test {
    public static void main(String[] args) {
        JwtBuilder jwtBuilder = Jwts.builder().setId("12306").setSubject("admin").setIssuedAt(new Date())
                .signWith(SignatureAlgorithm.HS256, "woniuxy")
                .claim("myName","罗蔚")
                .claim("myCountry", "China");
        System.out.println(jwtBuilder.compact());
    }
}
